# -*- coding: utf-8 -*-
# @Time: 2021/8/19 14:51
# @File: arg-35.py
# @DESC: https://leetcode-cn.com/problems/search-insert-position/
# 搜索插入位置

def fun1(nums, target):
    if target < nums[0]:
        return 0
    flag = 0
    for index, i in enumerate(nums):
        if i >= target:
            return index
        else:
            flag = index
    return flag + 1


nums = [1]
target = 0
r = fun1(nums, target)
print(r)
